package com.yueban.net.service;

import com.yueban.constant.HttpConstant;
import com.yueban.model.ActivityData;
import com.yueban.model.BaseResponse;
import com.yueban.model.User;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by guan on 17-8-7.
 */

public interface ActivityService {
    @FormUrlEncoded
    @POST(HttpConstant.SUBMIT_ACTIVITY)
    Observable<BaseResponse> submitActivity(@Field("content") String content,
                                            @Field("date") String date,
                                            @Field("category") String category,
                                            @Field("address") String address,
                                            @Field("userId") long userId);

    @POST(HttpConstant.SUBMIT_ACTIVITY)
    Observable<BaseResponse> submitActivity(@Body RequestBody requestBody);

    @GET(HttpConstant.ADD_COMMENT)
    Observable<BaseResponse> addComment(@Query("activityId") long activityId,
                                        @Query("userId") long userId,
                                        @Query("commentText") String comment);

    @GET(HttpConstant.GET_ACTIVITY)
    Observable<BaseResponse<List<ActivityData>>> getActivities(@Query("category") String category,
                                                               @Query("lastActivityId") long lastActivityId);

    @GET(HttpConstant.JOIN_ACTIVITY)
    Observable<BaseResponse<Boolean>> joinActivity(@Query("activityId") long activityId,
                                                   @Query("userId") long userId,
                                                   @Query("action") int action);

    @GET(HttpConstant.GET_JOIN_LIST)
    Observable<BaseResponse<List<User>>> getJoinList(@Query("activityId") long activityId);
}
